﻿using System;

namespace SilverMindMap.Core
{
    internal class Guard
    {
        public static void ArgumentNotNull(object argument, string argumentName, string errorMessage = null)
        {
            if (argument == null)
            {
                if (errorMessage != null)
                    throw new ArgumentNullException(argumentName, errorMessage);
                else
                    throw new ArgumentNullException(argumentName);
            }
        }
    }
}
